import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Test {
	public static final String FORMAT_DATE = "yyyy-MM-dd";

	public static void main(String[] args) {

		int b;
		int a = b = 1;

		System.out.println("a " + a + "b " + b);

		int sponsoredSearch = 0;
		int sponsoredNetwork = 1;
		int contentMatch = 1;
		int binarySum = sponsoredSearch*(2*2) + sponsoredNetwork*2 + (contentMatch >= 1 ? 1: 0);

		System.out.println("Sum = " + binarySum);

		System.out.println(formatString(Calendar.getInstance()));
		String serial;
		int reserveId = 1111;
		if(String.valueOf(reserveId).length() >= 8) serial = String.valueOf(reserveId);
		else serial = ("00000000").substring(String.valueOf(reserveId).length()) + reserveId;

		System.out.println(serial);

		reserveId = 123245678;
		if(String.valueOf(reserveId).length() >= 8) serial = String.valueOf(reserveId);
		else serial = ("00000000").substring(String.valueOf(reserveId).length()) + reserveId;
		System.out.println(serial);


		reserveId = 1232456789;
		if(String.valueOf(reserveId).length() >= 8) serial = String.valueOf(reserveId);
		else serial = ("00000000").substring(String.valueOf(reserveId).length()) + reserveId;
		System.out.println(serial);

		long start = System.currentTimeMillis();
		System.out.println("Start " + start);

		long end = System.currentTimeMillis();
		System.out.println("Start - end " + (end - start));


	}

	public static String formatString(Calendar date, String format){
		if(date == null) return null;
		return new SimpleDateFormat(format).format(date.getTime());
	}
	public static String formatString(Calendar date){
		return formatString(date, FORMAT_DATE);
	}



}
